package com.fulu.game.bi.controller.roi;

import com.fulu.game.bi.common.controller.BaseController;
import com.fulu.game.bi.entity.vo.Result;
import com.fulu.game.bi.entity.vo.roi.RoiStatDisplayVO;
import com.fulu.game.bi.entity.vo.roi.RoiStatQueryVO;
import com.fulu.game.bi.redis.service.roi.RoiStatService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ROI计算查询
 */
@RestController
@RequestMapping("/api/v1/in-out")
@Slf4j
public class RoiStatController extends BaseController {

    @Autowired
    private RoiStatService roiStatService;

    /**
     * ROI列表查询
     */
    @PostMapping("/list")
    public Result<List<RoiStatDisplayVO>> list(RoiStatQueryVO vo) {
        List<RoiStatDisplayVO> page = roiStatService.list(vo);

        return Result.success().data(page).msg("查询成功");
    }

    /**
     * ROI列表导出
     */
    @PostMapping("/export")
    public void export(RoiStatQueryVO vo) {
        roiStatService.export(vo);
    }

}
